import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';

@Injectable({providedIn: 'root'})
export class AppState {
  private isHandset$ = new BehaviorSubject<boolean>(false);
  private theme$ = new BehaviorSubject<string>('bee-dark-theme');
  constructor() { }

  isHandset(): Observable<boolean> {
    return this.isHandset$.asObservable();
  }

  setHandset(isHandset: boolean): void {
    this.isHandset$.next(isHandset);
  }

  setTheme(theme: string): void {
    this.theme$.next(theme);
  }

  theme(): Observable<string> {
    return this.theme$.asObservable();
  }
}
